package com.chhh.cranelease.mapper;

import com.chhh.cranelease.entity.Staff;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface StaffDao {
    @Select("select * from staff where s_state=1")
    List<Staff> selectAll();
    /*预约之后司机变为工作状态*/
    @Update("update staff set s_state=3 where s_name=#{s_name}")
    Integer updateStaff(Staff staff);
    /*换车之后司机变为在职状态*/
    @Update("update staff set s_state=1 where s_name=#{s_name}")
    Integer bringCarStaff(Staff staff);
}
